Repository navigation
fix(contexts): answer an unknown and an unmanageable uuid alike on scheme import - #3202
Open
rubenvdlinde wants to merge 1 commit into
Open
rubenvdlinde wants to merge 1 commit into
rubenvdlinde wants to merge 1 commit into
Conversation
3 of 5 tasks
rubenvdlinde
force-pushed
the
fix/noid/scheme-import-unknown-uuid
branch
from
November 3, 2026 14:51
1c7a206 to
1b9a79d
Compare
rubenvdlinde
force-pushed
the
feat/noid/app-menu-export-import
branch
from
November 3, 2026 14:51
a1b94a7 to
2471ff4
Compare
…heme import Importing a scheme answered 404 for a node whose uuid was unknown and 403 for a node on a table or view the user cannot manage. Such a node is now skipped the same way as an unknown one, with one log line, unless it already belongs to the application, the way the menu import skips the items it cannot use. A table to modify that is not here or cannot be managed is refused with the same 400 in both cases, and the controller now answers a refused import with 400 and rolls it back. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ruben van der Linde <ruben@conduction.nl>
rubenvdlinde
force-pushed
the
feat/noid/app-menu-export-import
branch
from
November 4, 2026 12:35
2471ff4 to
6368c26
Compare
rubenvdlinde
force-pushed
the
fix/noid/scheme-import-unknown-uuid
branch
from
November 4, 2026 12:35
1b9a79d to
1c2f7f3
Compare
rubenvdlinde
marked this pull request as ready for review
November 6, 2026 08:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sits on #3138 (menu export and import). Importing an application scheme now handles a table or view that isn't on this instance the same way as one the user can't manage. The menu import in #3138 also skips what it can't use and goes on.
Size: 215 lines: 64 code and 151 tests.
What was wrong
ContextService::importScheme()looked up every node of the scheme by uuid. An unknown uuid answered 404. A uuid of someone else's table was resolved and handed toupdate(), which refused it with a 403. So the answer told a user whether a uuid exists here. The tables to modify had the same split: 404 for an unknown uuid, 403 fromupdateTableStructure()for a table that can't be managed.Which answer, and why
The menu import in #3138 already skips an item whose table or view isn't part of the application, with the reason in the log, and goes on. That also lets an import from another instance go through when some of its tables didn't come along. Nodes now follow the menu:
update()does today, so an import doesn't drop it.<uuid>to modify is not here or cannot be managed by the user." I chose 400 over 403 because a 403 for a uuid that doesn't exist would be odd.ContextController::importScheme()didn't catchBadRequestError, so it now answers such a refusal with 400 and rolls the import back.This and #3201 both rework the node loop in
importScheme(), so whichever is merged second needs a small manual merge. It's simplest to merge this one first.How it was tested
On Nextcloud 34 with PostgreSQL, as alice importing into her application, with a table of bob's she can't see:
ContextServiceTest: a scheme with a manageable table, a table that is already a node, and an unknown and an unmanageable table and view;update()gets the manageable one and the shared node, and the four skips log the same line. A table to modify that is unknown or can't be managed gives the sameBadRequestError.ContextControllerTest: a refused import answers 400 and rolls back.composer cs:check, psalm and rector, all clean🖼️ Screenshots
No UI changes.
🏁 Checklist
/backport to stableX.X🤖 AI (if applicable)